PhysicsServer Class Reference

#include <PhysicsServer.h>

List of all members.

Public Member Functions

virtual ~PhysicsServer ()
bool init (int groundSizeX, int groundSizeY)
void shutdown ()
void setCrashId (int soundId)
bool registerClient (PhysicsClient *client)
bool update (double step)

Static Public Member Functions

static PhysicsServer * getInstance ()
static void collisionCallback (void *data, dGeomID o1, dGeomID o2)

Protected Attributes

int sound_id
int kacKez
dWorldID _world
dSpaceID _space
dJointGroupID _contactgroup
dSpaceID _envSpace
dGeomID _ground
vector< dGeomID > crashedGeomIds

Private Member Functions

 PhysicsServer ()
void checkCollision (void *data, dGeomID o1, dGeomID o2)

Private Attributes

vector< PhysicsClient * > _clientList

Static Private Attributes

static PhysicsServer _instance


Detailed Description

Interface for PhysicsServer class.

Definition at line 4 of file PhysicsServer.h.


Constructor & Destructor Documentation

PhysicsServer::~PhysicsServer (   )  [virtual]
 

A destructor.

Definition at line 14 of file PhysicsServer.cpp.

References shutdown().

PhysicsServer::PhysicsServer (   )  [private]
 

A constructor.

Definition at line 5 of file PhysicsServer.cpp.


Member Function Documentation

void PhysicsServer::checkCollision (  void *  data,
dGeomID  o1,
dGeomID  o2
)  [private]
 

Definition at line 105 of file PhysicsServer.cpp.

References _clientList, _ground, collisionCallback(), crashedGeomIds, and sound_id.

Referenced by collisionCallback().

void PhysicsServer::collisionCallback (  void *  data,
dGeomID  o1,
dGeomID  o2
)  [static]
 

a static member taking three argument and returning void.

Parameters:
data a void pointer.
o1 a dGeomID.
o2 a dGeomID. check collied geoms

Definition at line 94 of file PhysicsServer.cpp.

References checkCollision().

Referenced by checkCollision(), and update().

static PhysicsServer* PhysicsServer::getInstance (   )  [inline, static]
 

Definition at line 43 of file PhysicsServer.h.

References _instance.

Referenced by AnimationWindow::createCarPhysics().

bool PhysicsServer::init (  int  groundSizeX,
int  groundSizeY
) 
 

a normal member taking two arguments and returning a bool value.

Parameters:
groundSizeX an integer argument.
groundSizeY an integer argument.
Returns:
true if initialization is succesful creates physical world and space and set properties of these

Definition at line 20 of file PhysicsServer.cpp.

References _contactgroup, _envSpace, _ground, _space, and _world.

bool PhysicsServer::registerClient (  PhysicsClient *  client  ) 
 

a normal member taking one argument and returning a bool value.

Parameters:
client a pointer to PhysicsClient.
Returns:
true if registration is succesful add client to _clientList
See also:
_clientList

Definition at line 79 of file PhysicsServer.cpp.

References _clientList, _envSpace, _space, _world, and PhysicsClient::init().

Referenced by AnimationWindow::createCarPhysics().

void PhysicsServer::setCrashId (  int  soundId  ) 
 

Definition at line 231 of file PhysicsServer.cpp.

References sound_id.

void PhysicsServer::shutdown (   ) 
 

a normal member. destroy physical world, space and joint groups

Definition at line 52 of file PhysicsServer.cpp.

References _clientList, _contactgroup, _space, and _world.

Referenced by ~PhysicsServer().

bool PhysicsServer::update (  double  step  ) 
 

a normal member taking one argument and returning a bool value.

Parameters:
step a double argument.
Returns:
true if update is succesful update physical worlds simulation step,steps physical world, handles collisions, remove contact points

Definition at line 206 of file PhysicsServer.cpp.

References _clientList, _space, _world, and collisionCallback().


Member Data Documentation

vector<PhysicsClient*> PhysicsServer::_clientList [private]
 

a private member. list of physical clients

Definition at line 90 of file PhysicsServer.h.

Referenced by checkCollision(), registerClient(), shutdown(), and update().

dJointGroupID PhysicsServer::_contactgroup [protected]
 

Definition at line 67 of file PhysicsServer.h.

Referenced by init(), and shutdown().

dSpaceID PhysicsServer::_envSpace [protected]
 

Definition at line 68 of file PhysicsServer.h.

Referenced by init(), and registerClient().

dGeomID PhysicsServer::_ground [protected]
 

Definition at line 69 of file PhysicsServer.h.

Referenced by checkCollision(), and init().

PhysicsServer PhysicsServer::_instance [static, private]
 

Definition at line 83 of file PhysicsServer.h.

Referenced by getInstance().

dSpaceID PhysicsServer::_space [protected]
 

a protected variable. id of the physical space

Definition at line 66 of file PhysicsServer.h.

Referenced by init(), registerClient(), shutdown(), and update().

dWorldID PhysicsServer::_world [protected]
 

a protected variable. id of the physical world

Definition at line 61 of file PhysicsServer.h.

Referenced by init(), registerClient(), shutdown(), and update().

vector<dGeomID> PhysicsServer::crashedGeomIds [protected]
 

Definition at line 71 of file PhysicsServer.h.

Referenced by checkCollision().

int PhysicsServer::kacKez [protected]
 

Definition at line 55 of file PhysicsServer.h.

int PhysicsServer::sound_id [protected]
 

Definition at line 54 of file PhysicsServer.h.

Referenced by checkCollision(), and setCrashId().


The documentation for this class was generated from the following files:
Generated on Sun May 28 18:54:14 2006 for TraffEdu by  doxygen 1.4.6-NO